package jman.teemwork08;

import java.util.ArrayList;

class Student{
	private String name;
	private String schoolId;
	private int mark;
	public Student(){
		
	}
	public Student(String name,String schoolId,int mark){
		this.name=name;
		this.schoolId=schoolId;
		this.mark=mark;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getSchoolId() {
		return schoolId;
	}
	public void setSchoolId(String schoolId) {
		this.schoolId = schoolId;
	}
	public int getMark() {
		return mark;
	}
	public void setMark(int mark) {
		this.mark = mark;
	}
	public boolean equals(Student student){
		if(this.getSchoolId()==student.getSchoolId()){
			return true;
		}else{
			return false;
		}
	}
}
public class Q4 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		ArrayList<Student> a=new ArrayList<Student>();
		Student s1=new Student("s1","01",85);
		Student s2=new Student("s2","02",47);
		Student s3=new Student("s3","03",62);
		Student s4=new Student("s4","04",75);
		Student s5=new Student("s5","05",21);
		Student s6=new Student("s6","06",98);
		Student s7=new Student("s7","07",46);
		Student s8=new Student("s8","08",82);
		Student s9=new Student("s9","09",66);
		Student s10=new Student("s10","10",48);
		Student s11=new Student("s11","11",93);
		Student s12=new Student("s12","12",56);
		Student s13=new Student("s13","13",81);
		Student s14=new Student("s14","14",62);
		Student s15=new Student("s15","15",49);
		a.add(s1);
		a.add(s2);
		a.add(s3);
		a.add(s4);
		a.add(s5);
		a.add(s6);
		a.add(s7);
		a.add(s8);
		a.add(s9);
		a.add(s10);
		a.add(s11);
		a.add(s12);
		a.add(s13);
		a.add(s14);
		a.add(s15);
		a.trimToSize();
		for(int i=0;i<a.size();++i){
			for(int j=i+1;j<a.size();++j){
				if(a.get(i).getMark()<a.get(j).getMark()){
				Student temp=a.get(i);
				a.set(i,a.get(j));
				a.set(j,temp);
				}
			}
			
			System.out.println("姓名："+a.get(i).getName()+'\t'+"学号："+a.get(i).getSchoolId()+'\t'+"成绩："+a.get(i).getMark());
		}
	}

}
